package com.cy.pj.sys.dao;

import com.cy.pj.sys.pojo.SysUser;
import com.cy.pj.sys.pojo.SysUserDeptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


import java.util.List;

@Mapper
public interface SysUserDao {
    int getRowCount( String username);

    List<SysUserDeptVo> findPageObjects(
            String  username,
            Integer startIndex,
            Integer pageSize);

    int validById(
            @Param("id")Integer id,
            @Param("valid")Integer valid,
            @Param("modifiedUser")String modifiedUser);

    int insertObject(SysUser entity);

    SysUserDeptVo findObjectById(Integer id);

    int updateObject(SysUser entity);

    @Select("select * from sys_users where username=#{username} ")
    SysUser findUserByUserName(String username);

    int updatePassword(
            @Param("password")String password,
            @Param("salt")String salt,
            @Param("id")Integer id);
}
